const routes: any = [
  {
    path: '/login',
    name: 'Login',
    //@ts-ignore
    component: () => import('../views/login/index.vue'),
    meta: {
      title: '登录',
      hidden: true,
    },
  },
  {
    path: '/',
    name: 'Layout',
    redirect: '/home',
    //@ts-ignore
    component: () => import('../layout/index.vue'),
    meta: {
      title: 'layout',
      hidden: false,
    },
    children: [
      {
        path: '/home',
        name: 'home',
        //@ts-ignore
        component: () => import('../views/home/index.vue'),
        meta: {
          title: '主页',
          hidden: false,
          icon: 'House',
        },
      },
    ],
  },
  {
    path: '/404',
    name: '404',
    //@ts-ignore

    component: () => import('../views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    path: '/screen',
    name: 'Screen',
    //@ts-ignore
    component: () => import('../views/screen/index.vue'),
    meta: {
      icon: 'Monitor',
      title: '数据大屏',
    },
  },
]

export const asyncRoutes = [
  {
    path: '/acl',
    name: 'Acl',
    redirect: '/acl/user',
    //@ts-ignore
    component: () => import('../layout/index.vue'),
    meta: {
      icon: 'Lock',
      title: '权限管理',
    },
    children: [
      {
        path: '/acl/user',
        name: 'User',
        //@ts-ignore
        component: () => import('../views/acl/user/index.vue'),
        meta: {
          icon: 'UserFilled',
          title: '用户管理',
        },
      },
      {
        path: '/acl/role',
        name: 'Role',
        //@ts-ignore
        component: () => import('../views/acl/role/index.vue'),
        meta: {
          icon: 'Avatar',
          title: '角色管理',
        },
      },
      {
        path: '/acl/permission',
        name: 'Permission',
        //@ts-ignore
        component: () => import('../views/acl/permission/index.vue'),
        meta: {
          icon: 'Tools',
          title: '菜单管理',
        },
      },
    ],
  },
  {
    path: '/product',
    name: 'Product',
    redirect: '/product/attr',
    //@ts-ignore
    component: () => import('../layout/index.vue'),
    meta: {
      title: '产品管理',
      icon: 'Shop',
      hidden: false,
    },
    children: [
      {
        path: '/product/attr',
        name: 'Attr',
        //@ts-ignore
        component: () => import('../views/product/attr/index.vue'),
        meta: {
          title: '属性管理',
          hidden: false,
          icon: 'GobletSquareFull',
        },
      },
      {
        path: '/product/sku',
        name: 'Sku',
        component: () => import('../views/product/sku/index.vue'),
        meta: {
          title: 'sku管理',
          hidden: false,
          icon: 'Box',
        },
      },
      {
        path: '/product/spu',
        name: 'Spu',
        //@ts-ignore
        component: () => import('../views/product/spu/index.vue'),
        meta: {
          title: 'spu管理',
          hidden: false,
          icon: 'PriceTag',
        },
      },
      {
        path: '/product/trademark',
        name: 'Trademark',
        //@ts-ignore
        component: () => import('../views/product/trademark/index.vue'),
        meta: {
          title: '品牌管理',
          hidden: false,
          icon: 'Flag',
        },
      },
    ],
  },
]

export const anyRoutes = [
  {
    path: '/:patchMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
      title: '任意路由',
      hidden: true,
    },
  },
]
export default routes
